#include <stdio.h>
#include <string.h>
#include <stdlib.h>

struct ac
{
	int i;
	char data[0];
};

int main()
{
 /*8048560:	55                   	push   %ebp
 8048561:	89 e5                	mov    %esp,%ebp
 8048563:	83 e4 f0             	and    $0xfffffff0,%esp
 8048566:	83 ec 30             	sub    $0x30,%esp
 8048569:	c7 44 24 28 00 00 00 	movl   $0x0,0x28(%esp)*/
 void *p = NULL;

 /*8048570:	00 
 8048571:	c7 44 24 1e 61 62 63 	movl   $0x64636261,0x1e(%esp)	// (esp+0x1e)="abcd"
 8048578:	64 
 8048579:	c7 44 24 22 65 66 67 	movl   $0x68676665,0x22(%esp)	// (esp+0x1e)="efgh"
 8048580:	68 
 8048581:	66 c7 44 24 26 69 00 	movw   $0x69,0x26(%esp)*/		// (esp+0x26)='i'
 char buf[10] = "abcdefghi";	

 /*8048588:	c7 04 24 0e 00 00 00 	movl   $0xe,(%esp)
 804858f:	e8 6c fe ff ff       	call   8048400 <malloc@plt>
 8048594:	89 44 24 2c          	mov    %eax,0x2c(%esp)*/
 struct ac * info = (struct ac *)malloc(sizeof(struct ac) + 10);

 /*8048598:	8b 44 24 2c          	mov    0x2c(%esp),%eax	// eax=info
 804859c:	c7 00 09 00 00 00    	movl   $0x9,(%eax)*/	// (eax)=9
 info->i = 9;

 /*80485a2:	8b 44 24 2c          	mov    0x2c(%esp),%eax
 80485a6:	83 c0 04             	add    $0x4,%eax
 80485a9:	89 44 24 28          	mov    %eax,0x28(%esp)*/
 p = (void*)info->data;

 /*80485ad:	c7 44 24 04 04 00 00 	movl   $0x4,0x4(%esp)
 80485b4:	00 
 80485b5:	c7 04 24 d4 86 04 08 	movl   $0x80486d4,(%esp)
 80485bc:	e8 2f fe ff ff       	call   80483f0 <printf@plt>*/
 printf("%d\n", 4);

 /*80485c1:	8b 44 24 28          	mov    0x28(%esp),%eax	// eax=p
 80485c5:	89 44 24 08          	mov    %eax,0x8(%esp)
 80485c9:	8b 44 24 2c          	mov    0x2c(%esp),%eax	// eax=info
 80485cd:	89 44 24 04          	mov    %eax,0x4(%esp)
 80485d1:	c7 04 24 d8 86 04 08 	movl   $0x80486d8,(%esp)
 80485d8:	e8 13 fe ff ff       	call   80483f0 <printf@plt>*/
 printf("info address:%p\n", info, p);

 /*80485dd:	8b 44 24 28          	mov    0x28(%esp),%eax	// eax=p
 80485e1:	89 44 24 04          	mov    %eax,0x4(%esp)
 80485e5:	c7 04 24 e9 86 04 08 	movl   $0x80486e9,(%esp)
 80485ec:	e8 ff fd ff ff       	call   80483f0 <printf@plt>*/
 printf("   p address:%p\n", p);

 /*80485f1:	8d 44 24 28          	lea    0x28(%esp),%eax	// eax=&p
 80485f5:	89 44 24 04          	mov    %eax,0x4(%esp)
 80485f9:	c7 04 24 e9 86 04 08 	movl   $0x80486e9,(%esp)
 8048600:	e8 eb fd ff ff       	call   80483f0 <printf@plt>*/
 printf("   p address:%p\n", &p);

 /*8048605:	8b 44 24 2c          	mov    0x2c(%esp),%eax	// eax=info
 8048609:	8b 00                	mov    (%eax),%eax		// eax=info->i
 804860b:	89 c2                	mov    %eax,%edx		// edx=eax
 804860d:	8b 44 24 28          	mov    0x28(%esp),%eax	// eax=p
 8048611:	89 54 24 08          	mov    %edx,0x8(%esp)	// (esp+0x8)=info->i
 8048615:	8d 54 24 1e          	lea    0x1e(%esp),%edx	// edx=buf
 8048619:	89 54 24 04          	mov    %edx,0x4(%esp)	// (esp+0x4)=buf
 804861d:	89 04 24             	mov    %eax,(%esp)		// (esp)=p
 8048620:	e8 1b fe ff ff       	call   8048440 <strncpy@plt>*/
 strncpy((char*)p, buf, info->i);

 /*8048625:	8b 44 24 28          	mov    0x28(%esp),%eax	// eax=p
 8048629:	89 04 24             	mov    %eax,(%esp)
 804862c:	e8 df fd ff ff       	call   8048410 <puts@plt>*/
 printf("%s\n", (char*)p);

 /*8048631:	b8 00 00 00 00       	mov    $0x0,%eax
 8048636:	c9                   	leave  
 8048637:	c3                   	ret    
 8048638:	66 90                	xchg   %ax,%ax
 804863a:	66 90                	xchg   %ax,%ax
 804863c:	66 90                	xchg   %ax,%ax
 804863e:	66 90                	xchg   %ax,%ax*/
 return 0;
}
